package com.musemun.controller;

import com.musemun.common.CommonResult;
import com.musemun.common.ResultCode;
import com.musemun.common.ResultUtil;
import com.musemun.pojo.Crifo;
import com.musemun.pojo.Vo.CrifoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 张跃的测试类 无任何意义
 * </p>
 *
 * @author ZWYZY
 * @since 2020/4/21
 */
@RestController
@RequestMapping("/test")
@Api(tags = "张跃的测试模块", description = "封装一些测试方法")
public class TestController {
    @ApiOperation("输出张跃的第一句话测试")
    @GetMapping("/hello")
    public String sayHello(){
        return "Hello World";
    }

    @ApiOperation(value = "实现请求成功返回值封装测试",httpMethod = "POST")
    @PostMapping("/test1")
    public CommonResult test1(@RequestBody CrifoVo c, @RequestBody Crifo crifo){
        return ResultUtil.success();
    }
    @ApiOperation("实现请求失败返回值封装测试")
    @GetMapping("/test2")
    public CommonResult test2(){
        return ResultUtil.error(ResultCode.ERROR);
    }
}
